package com.xoa.controller.equipment;


import com.xoa.model.equipment.LimsEquipEventsPlan;
import com.xoa.service.equipment.LimsEquipEventsPlanService;
import com.xoa.util.LimsJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * @作者 杨岩林
 * @创建日期 15:04 2019/12/16
 * @类介绍 定期事件
 */
@Controller
@RequestMapping("LimsEquipEventsPlan")
public class LimsEquipEventsPlanController {

    @Autowired
    private LimsEquipEventsPlanService limsEquipEventsPlanService;

    //定期事件
    @RequestMapping("/eventIndex")
    public String eventIndex(){
        return "/app/equipment/periodicEvents/eventIndex";
    }

    //定期事件-新增页面
    @RequestMapping("/addEvent")
    public String addEvent(){
        return "/app/equipment/periodicEvents/addEvent";
    }

    //定期事件-选择设备
    @RequestMapping("/selectEvent")
    public String selectEvent(){
        return "/app/equipment/periodicEvents/selectEvent";
    }

    //定期事件-检验执行页面
    @RequestMapping("/carriedOut")
    public String carriedOut(){
        return "/app/equipment/periodicEvents/carriedOut";
    }

    //定期事件-期间执行页面
    @RequestMapping("/implement")
    public String implement(){
        return "/app/equipment/periodicEvents/implement";
    }

    //定期事件-期间核查记录
    @RequestMapping("/fication")
    public String fication(){
        return "/app/equipment/periodicEvents/fication";
    }

    //添加
    @RequestMapping("add")
    @ResponseBody
    public LimsJson add(LimsEquipEventsPlan limsEquipEventsPlan, String json, String paraJson){
        return limsEquipEventsPlanService.add(limsEquipEventsPlan,json,paraJson);
    }

    //删除 可以单个可以多个
    @RequestMapping("delete")
    @ResponseBody
    public LimsJson delete(String ids){
        return limsEquipEventsPlanService.delete(ids);
    }

    //修改 可以单个可以多个
    @RequestMapping("update")
    @ResponseBody
    public LimsJson update(String ids,LimsEquipEventsPlan limsEquipEventsPlan,String json){
        return limsEquipEventsPlanService.updateAll(ids,limsEquipEventsPlan,json);
    }

    //展示详情
    @RequestMapping("showDetils")
    @ResponseBody
    public LimsJson showDetils(Integer id){
        return limsEquipEventsPlanService.queryOne(id);
    }

    //列表展示
    @RequestMapping("showAll")
    @ResponseBody
    public LimsJson showAll(LimsEquipEventsPlan limsEquipEventsPlan,Integer page,Integer limit){
        return limsEquipEventsPlanService.queryAll(limsEquipEventsPlan,page,limit);
    }

    //事件的 参数值
    @RequestMapping("showEventParas")
    @ResponseBody
    public LimsJson showEventParas(Integer eventId){
        return limsEquipEventsPlanService.queryEventParas(eventId);
    }

}
